package com.yss.adapter.template;

import com.yss.adapter.AdapterExtraInfo;
import com.yss.netty.future.ResponseCallback;
import com.yss.netty.protocol.CommandType;
import com.yss.netty.protocol.SerType;
import com.yss.netty.util.Host;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
public class INettyAdapterInfo extends AdapterExtraInfo {

    /**
     * Host
     */
    private Host host;

    /**
     * Serialization method
     */
    private SerType serType;

    /**
     * CommandType
     */
    private CommandType commandType;

    /**
     * Whether to send asynchronously
     */
    private boolean isAsync;

    /**
     * If isAsync is true
     * you should create a callback
     */
    private ResponseCallback responseCallback;

    public INettyAdapterInfo(Host host, SerType serType, CommandType commandType,
                             boolean isAsync, ResponseCallback responseCallback, Object params) {
        super(params);
        this.host = host;
        this.serType = serType;
        this.commandType = commandType;
        this.isAsync = isAsync;
        this.responseCallback = responseCallback;
    }
}
